package com.second.app.thread.stack;

/**
 * @Author GYZ
 * <pre>
 *
 * </pre>
 */
public class Run {

    public static void main(String[] args) {
        MyStack myStack = new MyStack();
        new Thread(new Runnable() {
            @Override
            public void run() {
               while (true){
                   myStack.push();
               }
            }
        },"生产线程").start();

        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        new Thread(new Runnable() {
            @Override
            public void run() {
                while (true){
                    myStack.pop();
                }
            }
        },"消费线程").start();
    }
}
